﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using ModuleOrder.Views;
using Microsoft.Practices.ServiceLocation;
using ShellInfrastructure;
using Microsoft.Practices.Prism.Events;
using EventInfrastructure;

namespace ShopShell.OrderCommands
{
    public class AssignMeCommand : ICommand
    {
        [Dependency]
        public IRegionManager RegionManager { get; set; }

        [Dependency]
        public IEventAggregator EventAggregator { get; set; }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            EventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
            EventAggregator.GetEvent<AssignOrderEvent>().Publish(true);              
        }

    }
}
